<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../css/iconfont.css" />
    <style type="text/css">
        i.iconfont {
            font-size: 1.2rem;
            color: #fff;
        }

        .aui-btn.aui-pull-right {
            font-size: 0.75rem;
        }

        .aui-btn.aui-pull-right.hidden,
        .hidden {
            display: none;
        }

        .aui-pull-right .iconAnkerwebicon- {
            font-size: 0.8rem;
        }
    </style>
</head>

<body>
    <header class="aui-bar aui-bar-nav header" id="aui-header">
        <a class="aui-btn aui-pull-left" tapmode onclick="closeWin()">
            <span class="aui-iconfont aui-icon-left"></span>
        </a>
        <div id="frametitle" class="aui-title">开始盘点</div>
        <a class="aui-btn aui-pull-right" tapmode onclick="do_save_pandian()">
            保存
        </a>
    </header>
</body>
<script type="text/javascript" src="../script/api.js "></script>
<script type="text/javascript">
    window._onclose = null;
    window.closeWin = function() {
        api.sendEvent({
            name: 'closepandianstartwin'
        });
    };
    window.do_save_pandian = function() {
        api.sendEvent({
            name: 'do_save_pandian'
        });
    }
    apiready = function() {
        var header = $api.byId('aui-header');
        var statusBar = api.require('statusBar');
        var statusBarHeight = statusBar.getStatusBarHeight();
        if (statusBarHeight > 25) {
            $api.css(header, 'border-top: solid ' + statusBarHeight + 'px #000;');
        }
        // $api.fixStatusBar(header);
        var headerH = $api.offset(header).h;
        var frameH = api.winHeight;
        var pageParam = {
            header_h: headerH,
        }
        Object.keys(api.pageParam).forEach(function(key) {
            if (key != 'title' && key != 'url') {
                pageParam[key] = api.pageParam[key];
            }
        });
        api.openFrame({
            name: "pandianstart_frm",
            url: 'pandianstart_frm.html',
            bounces: false,
            pageParam: pageParam,
            rect: {
                x: 0,
                y: headerH,
                w: 'auto',
                h: frameH - headerH,
            }
        });
        api.addEventListener({
            name: 'keyback'
        }, function(ret, err) {
            if (ret) {
                api.sendEvent({
                    name: 'closepandianstartwin'
                });
            }
        });
    };
</script>

</html>
